# encoding: utf-8
from flask import jsonify

# 成功
def success(data=None):
    return jsonify({"code": "0", "result": data})


# 参数错误
def params_error(message=None):
    return jsonify({"code": "1002", "errorMsg": message})

# 未授权
def unauthorized():
    return jsonify({"code": "1003", "errorMsg": "请重新登录"})

# 系统错误
def server_error():
    return jsonify({"code": "1004", "errorMsg": "系统错误"})
